{template 'common/header'}
<title>消息提醒设置</title>
<style>
	.mui-trans{
		transition-duration: 0.2s;
		transform: translate(43px, 0px);
	}
	.mui-none-trans{
		transition-duration: 0.2s;
		transform: translate(0px, 0px);
	}
</style>
<div id='container'></div>

<script id='tpl_main' type='text/html'>
		<header id="header" class="mui-bar mui-bar-nav">
			<button class="mui-action-back mui-btn mui-btn-blue mui-btn-link mui-btn-nav mui-pull-left header-back-icon">
					<span class="mui-icon mui-icon-left-nav"></span>
					消息提醒设置
				</button>
		</header>
		<div class="mui-content content-bg-w7">
			<ul class="mui-table-view">
				<li class="mui-table-view-cell">
					<span>订单提交通知</span>
					<div notice="submit" on="<%notice.submit%>" class="mui-switch mui-switch-blue">
						<div class="mui-switch-handle"></div>
					</div>
				</li>
				<li class="mui-table-view-cell">
					<span>自提订单通知</span>
					<div notice="carrier"  on="<%notice.carrier%>" class="mui-switch mui-switch-blue">
						<div class="mui-switch-handle"></div>
					</div>
				</li>
				<li class="mui-table-view-cell">
					<span>订单取消通知</span>
					<div notice="cancel"  on="<%notice.cancel%>" class="mui-switch mui-switch-blue">
						<div class="mui-switch-handle"></div>
					</div>
				</li>
				<li class="mui-table-view-cell">
					<span>购买成功通知</span>
					<div notice="pay"  on="<%notice.pay%>" class="mui-switch mui-switch-blue">
						<div class="mui-switch-handle"></div>
					</div>
				</li>
				<li class="mui-table-view-cell">
					<span>订单发货通知</span>
					<div notice="send"  on="<%notice.send%>" class="mui-switch mui-switch-blue">
						<div class="mui-switch-handle"></div>
					</div>
				</li>
				<li class="mui-table-view-cell">
					<span>订单收货通知</span>
					<div notice="finish"  on="<%notice.finish%>" class="mui-switch mui-switch-blue">
						<div class="mui-switch-handle"></div>
					</div>
				</li>
				<li class="mui-table-view-cell">
					<span>退款申请通知</span>
					<div notice="refund"  on="<%notice.refund%>" class="mui-switch mui-switch-blue">
						<div class="mui-switch-handle"></div>
					</div>
				</li>
				<li class="mui-table-view-cell">
					<span>退款结果通知</span>
					<div notice="refund1"  on="<%notice.refund1%>" class="mui-switch mui-switch-blue">
						<div class="mui-switch-handle"></div>
					</div>
				</li>
				<li class="mui-table-view-cell">
					<span>会员升级通知</span>
					<div notice="upgrade" on="<%notice.upgrade%>" class="mui-switch mui-switch-blue">
						<div class="mui-switch-handle"></div>
					</div>
				</li>
				<li class="mui-table-view-cell">
					<span>充值成功通知</span>
					<div notice="recharge_ok" on="<%notice.recharge_ok%>" class="mui-switch mui-switch-blue">
						<div class="mui-switch-handle"></div>
					</div>
				</li>
				<li class="mui-table-view-cell">
					<span>充值退款通知</span>
					<div notice="recharge_refund" on="<%notice.recharge_refund%>" class="mui-switch mui-switch-blue">
						<div class="mui-switch-handle"></div>
					</div>
				</li>
				<li class="mui-table-view-cell">
					<span>提现申请通知</span>
					<div notice="withdraw" on="<%notice.withdraw%>" class="mui-switch mui-switch-blue">
						<div class="mui-switch-handle"></div>
					</div>
				</li>
				<li class="mui-table-view-cell">
					<span>提现成功通知</span>
					<div notice="withdraw_ok" on="<%notice.withdraw_ok%>" class="mui-switch mui-switch-blue">
						<div class="mui-switch-handle"></div>
					</div>
				</li>
				<li class="mui-table-view-cell">
					<span>提现失败通知</span>
					<div notice="withdraw_fail" on="<%notice.withdraw_fail%>" class="mui-switch mui-switch-blue">
						<div class="mui-switch-handle"></div>
					</div>
				</li>
				<%if hascommission%>
				<li class="mui-table-view-cell">
					<span>成为分销商通知</span>
					<div notice="commission_become"  on="<%notice.commission_become%>" class="mui-switch mui-switch-blue">
						<div class="mui-switch-handle"></div>
					</div>
				</li>
				<li class="mui-table-view-cell">
					<span>等级提升通知</span>
					<div notice="commission_upgrade"  on="<%notice.commission_upgrade%>" class="mui-switch mui-switch-blue">
						<div class="mui-switch-handle"></div>
					</div>
				</li>
				<li class="mui-table-view-cell">
					<span>新增下线通知</span>
					<div notice="commission_agent_new"  on="<%notice.commission_agent_new%>" class="mui-switch mui-switch-blue">
						<div class="mui-switch-handle"></div>
					</div>
				</li>
				<li class="mui-table-view-cell">
					<span>下线付款通知</span>
					<div notice="commission_order_pay"  on="<%notice.commission_order_pay%>" class="mui-switch mui-switch-blue">
						<div class="mui-switch-handle"></div>
					</div>
				</li>
				<li class="mui-table-view-cell">
					<span>下线收货通知</span>
					<div notice="commission_order_finish"  on="<%notice.commission_order_finish%>" class="mui-switch mui-switch-blue">
						<div class="mui-switch-handle"></div>
					</div>
				</li>
				<li class="mui-table-view-cell">
					<span>提现申请通知</span>
					<div notice="commission_apply"  on="<%notice.commission_apply%>" class="mui-switch mui-switch-blue">
						<div class="mui-switch-handle"></div>
					</div>
				</li>
				<li class="mui-table-view-cell">
					<span>提现处理通知</span>
					<div notice="commission_check"  on="<%notice.commission_check%>" class="mui-switch mui-switch-blue">
						<div class="mui-switch-handle"></div>
					</div>
				</li>
				<li class="mui-table-view-cell">
					<span>商家打款通知</span>
					<div notice="commission_pay"  on="<%notice.commission_pay%>" class="mui-switch mui-switch-blue">
						<div class="mui-switch-handle"></div>
					</div>
				</li>
				<%/if%>
			</ul>
		</div>

</script>

<script language="javascript">
	require(['tpl', 'core'], function(tpl, core) {

		core.json('member/notice',{},function(json){
			$('#container').html(  tpl('tpl_main',json.result) );
			$('.mui-table-view-cell .mui-switch').each(function(){
				var on = $(this).attr('on');
				if(on==''){
					$(this).addClass('mui-active');
					$(this).find('.mui-switch-handle').addClass('mui-trans');
				}
			}).click(function(){
				var notice = $(this).attr('notice');
				var on = $(this).attr('on')==''?'-1':'';
				$(this).attr('on',on);
				if(on==''){
					$(this).addClass('mui-active');
					$(this).find('.mui-switch-handle').addClass('mui-trans');
				} else{
					$(this).removeClass('mui-active');
					$(this).find('.mui-switch-handle').removeClass('mui-trans').addClass('mui-none-trans');
				}
				core.json('member/notice',{op:'set',notice:notice,on:on},function(pjson){
				},false,true);
			})
		},true);

	})
</script>
{template 'common/footer'}